# -*- coding: utf-8 -*-
"""
@author: huijiang
@date: 2021.11.15
"""
import sys
import os


def app_path():
    """Returns the base application path."""
    if hasattr(sys, 'frozen'):
        # Handles PyInstaller
        return os.path.dirname(sys.executable)
    return os.path.dirname(__file__)


if __name__ == "__main__":
    print(app_path())
    print('__file__:', __file__)
    print('sys.executable:', sys.executable)
    print('sys.argv[0]:', sys.argv[0])
    print('os.getcwd():', os.getcwd())
    print('sys.frozen:', getattr(sys, 'frozen', False))
    print('sys._MEIPASS:', getattr(sys, '_MEIPASS', None))
